#pragma once
#include "instrument.h"
#include "SineWave.h"
#include "AR.h"
#include <vector>

class CChorusInstrument :
	public CInstrument
{
public:
	CChorusInstrument(void);
	~CChorusInstrument(void);

	
	virtual void Start();
    virtual bool Generate();

    void SetFreq(double aF) {mSinewave.SetFreq(aF);}
    void SetAmplitude(double aA) {mSinewave.SetAmplitude(aA);}
    void SetDuration(double aD) {mAr.SetDuration(aD);}

	void SetWet(double aA){
		mWet = 1 + aA;
	}

	void SetFrameCopyFreq(double aF){
		//mFrameCopy[0] = mFrameCopy[0].SetFreq(aF);
	  // mFrameCopy[1] = mFrameCopy[1].SetFreq(aF);
	}

	void SetNote( CNote *aNote );


private:
	std::vector<short> mQueue;
	int k;
	double mWet;
    CSineWave   mSinewave;
    double mDuration;
    double mTime;
	CAR mAr;
	double mFrameCopy[2];
	double chorusFrame[2];
	int mPeriod;


};

